OOPs with C++

Course Code: UGCOA22J402

Credits: 6 (Theory: 4, Practical: 2)

Type: Major

UNIT 1

UNIT 2

UNIT 3

UNIT 4


Sample Lab Work (indicative) (2 Credits, 60 Hours)

  1. Implement a basic calculator using functions and handle user input/output. Use a loop to allow the user to perform multiple calculations.
  2. Implement stack operations: push, pop, and display using arrays.
  3. Define a class with multiple attributes. Implement methods to set and get these attributes. Create objects of the class and manipulate class data.
  4. Create a class with a parameterized constructor and utilise it to initialise object attributes dynamically.
  5. Define a class with multiple constructors (default and parameterized) to showcase constructor overloading.
  6. Create two classes, declare a friend function that takes objects of both classes as arguments, and accesses their private/protected members. Use a friend function to access private and protected members of a class.
  7. Implement a static function that returns the value of a static variable (e.g., object count) without the need for an object.
  8. Implement a class that overloads the == operator to compare the values of two objects.
  9. Implement a three-level inheritance hierarchy and access members of all ancestors from the derived class.
  10. Implement a base class pointer that dynamically calls the correct derived class functions using virtual functions.
  11. Implement a program utilising public, protected, and private inheritance and observe how it influences member accessibility.
  12. Implement several functions with the same name but different parameters (different type/number).
  13. Implement an abstract class with pure virtual functions and override them in the derived class.
  14. Create a program to Merge two text files into a third one. Search for a particular piece of data in a file.
  15. Implement basic operations like adding, deleting, updating, and displaying elements of a vector and List.
  16. Implement a shopping cart using STL where products (with price and quantity) are stored using suitable STL containers and users can add, modify, and remove products from the cart.
  17. Write a program to implement a file compression algorithm.
  18. Write a program to implement a file encryption algorithm.
  19. Write a program to implement a template method using virtual functions.
  20. Write a program to demonstrate dynamic dispatch using virtual functions.

SUGGESTED TEXTBOOKS

  1. E. Balagurusamy: Object oriented programming with C++
  2. Bjarne Stroustrup: The C++ programming language.
  3. Robert Lafore: Object oriented programming in C++